package com.disgnpattern.learn.chapter9.after;

import lombok.Data;

/**
 * @author dxy
 * @version 1.0
 * @date 2021/10/24 9:22
 * @decripton 简历
 * @mail victorydeng@163.com
 */
@Data
public class Resume implements Cloneable {
    private String name;
    private String sex;

    public Resume(WorkExperience workExperience) throws CloneNotSupportedException {
        this.workExperience = workExperience.clone();
    }

    @Override
    protected Resume clone() throws CloneNotSupportedException {
        Resume resume = new Resume(this.workExperience);
        resume.age = this.age;
        resume.name = this.name;
        resume.sex = this.sex;
        return resume;
    }

    private String age;

    private WorkExperience workExperience;



    public Resume(String name) {
        this.name = name;
        workExperience = new WorkExperience();
    }

    //设置个人信息
    public void setPersonalInfo(String age, String sex) {
        this.sex = sex;
        this.age = age;
    }

    //设置工作经历
    public void setWorkExperience(String timeArea, String company) {
        workExperience.timeArea =timeArea;
        workExperience.company = company;
    }

    public void display() {
        System.out.println(String.format("个人基础信息：%s,%s,%s", name, sex, age));
        System.out.println(String.format("工作经历：%s,%s", workExperience.getTimeArea(),workExperience.getCompany()));
    }
}
